<%-- 
    Document   : manageProduct
    Created on : Apr 16, 2013, 11:41:01 AM
    Author     : NganNLK60334
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>

<jsp:useBean id="checkerBean" class="General.XMLChecker"/>
<c:set var="path" value='<%= getServletContext().getRealPath("/")%>'/>
<jsp:setProperty name="checkerBean" property="realPath" value="${path}"/>

<jsp:setProperty name="checkerBean" property="webPath" value="/WEB-INF/Products.xml"/>
<c:if test="${not checkerBean.validFile}">
    <jsp:forward page="/AdminController">
        <jsp:param name="action" value="ProductsXmlCheck"/>
        <jsp:param name="current" value="/admin/manageProduct.jsp"/>
    </jsp:forward>
</c:if>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="${pageContext.request.contextPath}/JavaScript/AdminScript.js"></script>
        <title>eHatClub</title>
    </head>
    <body>
        <div class="page-wraper">

                <h1 align="center">Manage Product</h1>
                <c:import url="/WEB-INF/Products.xml" var="xmldoc" charEncoding="UTF-8"/>
                <c:import url ="/WEB-INF/Admin/manageProduct.xsl" var="xsldoc" charEncoding="UTF-8"/>
                <x:transform xml="${xmldoc}" xslt="${xsldoc}"/>

        </div>
    </body>
</html>
